package com.itmuch.cloud.service.impl;

import com.itmuch.cloud.dto.UserDTO;
import com.itmuch.cloud.feign.UserFeignClient;
import com.itmuch.cloud.pojo.User;
import com.itmuch.cloud.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

@Service
@Slf4j
public class UserServiceImpl implements UserService {
    @Autowired
    private UserFeignClient userFeignClient;

    @Override
    public User findById(Long id) {
        return userFeignClient.findById(id);
    }

    @Override
    public String getOrder(Long userId, Long orderId) {
        return userFeignClient.getOrder(userId, orderId);
    }

    @Override
    public String search1(String name, Integer age, Integer size) {
        return userFeignClient.search1(name, age, size);
    }

    @Override
    public String search2(Map<String, Object> params) {
        return userFeignClient.search2(params);
    }

    @Override
    public String createUser(UserDTO user) {
        return userFeignClient.createUser(user);
    }

    @Override
    public String uploadFile(MultipartFile file, String description) {
        return userFeignClient.uploadFile(file, description);
    }
}
